import { Base } from '../../utils/base.js'

class Fenxiao extends Base {
  constructor() {
    super();
  }
  //开通分销商
  register(param, cb) {
    var that = this;
    var allParams = {
      url: 'distribut/register',
      data: param,
      type: 'post',
      sCallback: function (res) {
        cb && cb(res)
      }
    };
    this.request(allParams);
  }
  //今日收益总额
  dayMoney(param, cb) {
    var that = this;
    var allParams = {
      url: 'distribut/day-money',
      data: param,
      type: 'post',
      sCallback: function (res) {
        cb && cb(res)
      }
    };
    this.request(allParams);
  }
  //分销订单
  getOrders(param, cb){
    var that = this;
    var allParams = {
      url: 'distribut/log?page='+param.page,
      data: param,
      type: 'post',
      sCallback: function (res) {
        cb && cb(res)
      }
    };
    this.request(allParams);
  }
  //我的会员
  getMember(param, cb) {
    var that = this;
    var allParams = {
      url: 'distribut/sub-member?page=' + param.page,
      data: param,
      type: 'post',
      sCallback: function (res) {
        cb && cb(res)
      }
    };
    this.request(allParams);
  }
  //冻结收益
  getFrozen(param, cb) {
    var that = this;
    var allParams = {
      url: 'distribut/frozen-money',
      data: param,
      type: 'post',
      sCallback: function (res) {
        cb && cb(res)
      }
    };
    this.request(allParams);
  }
  //下级绑定为会员
  bind(param, cb) {
    var that = this;
    var allParams = {
      url: 'distribut/bind',
      data: param,
      type: 'post',
      sCallback: function (res) {
        cb && cb(res)
      }
    };
    this.request(allParams);
  }
  //分销个性图片
  getDiyImage(param,callback) {
    var params = {
      url: 'carousel-item/items',
      data: param,
      type: 'post',
      sCallback: function (data) {
        callback && callback(data);
      }
    }
    this.request(params);
  }
}
export { Fenxiao }